#include <stdio.h>

int Factorial( const int N );

int main()
{
    int N, NF;
				
    scanf("%d", &N);
    NF = Factorial(N);
    if (NF)  printf("%d! = %d\n", N, NF);
    else printf("Invalid input\n");

    return 0;
}

/* 你的代码将被嵌在这里 */
int Factorial( const int N ){
    int result;
    int i;
    if(N>=0){
        result=1;
        for(i=1;i<=N;i++){
            result*=i;
        }
        
    }else {
        result =0;
    }
    
    return result;
    
}